#ifndef HP2DRRECTANGULARVIEW_H
#define HP2DRRECTANGULARVIEW_H

/**
 * Header file with the HP2DRectangularView class declaration.
 * @author Dejan Lekic <dejan.lekic@kcl.ac.uk>
 */

#include <fltk/Window.h>
#include <fltk/Group.h>
#include <fltk/Button.h>
#include <fltk/Input.h>
#include <fltk/Widget.h>

#include <profo/profo.h>
#include <profo/View.h>
#include <profo/ProteinView2D.h>
#include <profo/IAlgorithm.h>

namespace profo {

class ProteinView2D;

/**
 * HP2DRectangularView is, as the name suggests the VIEW component in our
 * MVC-based simulator, component with responsibility to accurately display
 * current state of the MODEL - an object of the Protein type.
 *
 * From PROFO project's architecture point of view this class belongs to
 * the presentation layer.
 *
 * @author Dejan Lekic <dejan.lekic@kcl.ac.uk>
 */
class HP2DRectangularView: public View  {
  public: // ------------------------------------------------------- public ---
  // VARIABLES
  fltk::Button *nwButton;
  fltk::Button *nButton;
  fltk::Button *neButton;
  fltk::Button *wButton;
  fltk::Button *eButton;
  fltk::Button *swButton;
  fltk::Button *sButton;
  fltk::Button *seButton;
  fltk::Button *parseButton; ///< A button to parse the input protein string.

  // METHODS
  HP2DRectangularView(Protein& argProtein, IAlgorithm& argAlgorithm);
  void show();
  virtual void updateView();
  void updateControlButtons(unsigned char arg);
  // ACCESSORS
  Protein& getProtein() { return _proteinModelRef; }
  IAlgorithm& getAlgorithm() { return _algorithmRef; }

  // CALLBACKS
  static void parseButtonCb(fltk::Button* w, void* data = 0);
  static void neButtonCb(fltk::Button* w, void* data = 0);
  static void closeCb(fltk::Widget* w, void* data = 0);

  private: // ----------------------------------------------------- private ---
  // VARIABLES
  // Note that this indentation is intentional because we want to
  fltk::Window *_window;                     // see the hierarchy of widgets
    profo::ProteinView2D *_proteinView;
    fltk::Group *_controlPanel;
      fltk::Input* _input; ///< fltk::Input object which takes the protein input.
      fltk::Widget *_algorithmInfo; /**< Label which gives information about the
                                    algorithm that is currently in use */
      fltk::Widget *_energyLabel; ///< Label with the current energy
  Protein& _proteinModelRef; ///< A pointer to the Protein object (Model in MVC)
  IAlgorithm& _algorithmRef; ///< A reference to the IAlgorithm object (Controller in MVC)
}; // HP2DRectangularViev class

} // profo namespace

// $Id: HP2DRectangularView.h 45 2009-04-26 15:59:46Z dejan.lekic $

#endif // HP2DRRECTANGULARVIEW_H
